<?php
namespace App\Http\Controllers\Admin;

use App\admin\TableView\AdminViewList;
use App\admin\TableView\ApilistView;
use Illuminate\Http\Request;

class HomeController extends BaseController
{
    /**
     * 首页
     */

    public function __construct()
    {

        parent::__construct();

    }

    public function index()
    {

        return view('admin.home.index');
    }

    /**
     * 线上代码同步
     */
    public function setCodeGit(Request $request)
    {
        $shell01 = "cd /www/meice/main";
        $shell02 = "git pull origin master";
//        $shell02 = "ls";
        try {
            passthru($shell01, $rst01);
            passthru($shell02, $rst02);
            dd($rst02);
        } catch (Exception $e) {
            echo 'error=' . $e->getMessage();
        }
    }


    /**@api
     * /mcadmin/test
     */
    public function test(Request $request){
        return (new AdminViewList())
            ->get_html($this);
    }
    /**@api
     * /mcadmin/apilist
     */
    public function apilist(Request $request){
        return (new ApilistView())
            ->get_html($this);
    }

    /**
     * 接口编辑页面
    */
    public function apiedit(Request $request){
        return view('admin.home.apiedit');
    }



    /**@api
     * /mcadmin/test
     */
    public function luyou(Request $request){
        return view('admin.home.luyou');
    }
}